package com.example.base.app

import android.app.Application
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStore
import com.alibaba.android.arouter.launcher.ARouter
import com.example.base.BuildConfig
import com.tencent.mmkv.MMKV

open class BaseApp:Application() {
    companion object{
        lateinit var appContext:BaseApp
    }
    override fun onCreate() {
        super.onCreate()
        appContext=this
        //初始化ARouter
        if (BuildConfig.DEBUG) {
            ARouter.openLog()
            ARouter.openDebug()
        }
        ARouter.init(this)
        MMKV.initialize(this)
    }

    override fun onLowMemory() {
        super.onLowMemory()
    }

    override fun onTerminate() {
        super.onTerminate()
    }
}